package com.hxkj.dao.impl;

import com.hxkj.dao.LeafletDao;
import com.hxkj.domain.po.Leaflet;
import com.hxkj.mapper.LeafletMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: zzx
* @version: 1.0
* @datetime: 2018-06-05 17:57:34
*
*/
@Service("leafletDao")
public class LeafletDaoImpl implements LeafletDao {

    @Resource
    private LeafletMapper leafletMapper;


    @Override
    public Leaflet get(Long leafletId) {
        return leafletMapper.selectByPrimaryKey_(leafletId);
    }

    @Override
    public List<Leaflet> get(Leaflet leaflet) {
        return leafletMapper.select(leaflet);
    }

    @Override
    public int delete(Long leafletId) {
        return leafletMapper.deleteByPrimaryKey(leafletId);
    }

    @Override
    public int delete(Leaflet leaflet) {
        return leafletMapper.delete(leaflet);
    }

    @Override
    public int save(Leaflet leaflet) {
        return leafletMapper.insert(leaflet);
    }

    @Override
    public int update(Leaflet leaflet) {
        return leafletMapper.update(leaflet);
    }

    @Override
    public List<Leaflet> getLeafletList(Leaflet leaflet) {
        return leafletMapper.getLeafletList(leaflet);
    }

    @Override
    public List<Leaflet> getLeafletHeadline(Leaflet leaflet) {
        return leafletMapper.getLeafletHeadline(leaflet);
    }

    @Override
    public List<Leaflet> getLeafletByStatus(Leaflet leaflet) {
        return leafletMapper.getLeafletByStatus(leaflet);
    }

    @Override
    public List<Leaflet> getLeafletByIds(Leaflet leaflet) {
        return leafletMapper.getLeafletByIds(leaflet);
    }
}
